/**
 * @Classname AttAtdRecMapper
 * @Description TODO
 * @author Tale-Mi
 * @date 2019/2/17 22:34
 */
package org.tale.mscp.notify.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.tale.mscp.notify.entity.AttAtdRec;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface AttAtdRecMapper extends BaseMapper<AttAtdRec> {


    @Select({"<script>", "select EquID,rec.EmpID,emp.EmpName,RecDate,RecTime from att_ArdRec rec ",
            "inner join sys_Emp emp on rec.EmpID=emp.EmpID where RecDate &gt; =#{startDate} and RecDate &lt; =#{endDate}",
            "<if test='name!=null'>AND emp.EmpName = #{name}</if>",
            "<if test='userId!=null'>AND rec.EmpID = #{userId}</if>", "</script>"})
    List<AttAtdRec> getRecordUserName(LocalDate startDate, LocalDate endDate, String name, String userId);
}
